package com.kvn.idpt_usage.controller;

import com.kvn.idpt_usage.entity.JobInfo;
import com.kvn.idpt_usage.service.JobInfoService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * Created by wangzhiyuan on 2018/11/20
 */
@RestController
@RequestMapping("/example")
public class Example {
    @Resource
    JobInfoService jobInfoService;

    @GetMapping("/test")
    public String test(){
        return "test";
    }

    /**
     * 测试链接： http://localhost:8080/ssm/example/jobInfo?jobCode=com.kvn.dal.core.single_node.SingleNodeJob
     * @param jobCode
     * @return
     */
    @GetMapping("/jobInfo")
    public JobInfo getJobInfo(String jobCode){
        return jobInfoService.selectOne(jobCode);
    }
}
